      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
         <ul class="nav nav-tabs mytabs">
		  	 <li  class="active"><a href="<?=site_url()?>/user/index">用户列表</a></li>
		  </ul>
          <div class="row">
            <div class="col-md-12">
              <div class="table-responsive">
                 <div>账户余额：<?php echo $user['balance'].'元';?></div>
                 <form role="form" id="templatemo-preferences-form" onsubmit="return false;">
                <div class="row">
                	<input type="hidden" class="form-control" id="userid" value="<?php echo $user['id'];?>" >
                   <div class="col-md-6 margin-bottom-15">
                    <label for="firstName" class="control-label">请输入充值金额(元)</label>
                	<input type="text" class="form-control" id="money" value="">
                  </div>
	              </div>
	              <div class="row templatemo-form-buttons">
	                <div class="col-md-12">
	                  <button type="submit" class="btn btn-primary" id="submit_btn">充值</button>
	                </div>
                </div>
                </form>
              </div>
            </div>
          </div>
        </div>
      </div>
<script>
	$(document).ready(function() {
		$("#submit_btn").click(function() {
			if(confirm("确认充值吗？")){
			var userid = $("#userid").val();
			var money = $("#money").val();
			$.ajax({
				url : '<?php echo site_url('user/rechargeaccount')?>',
				type : "post",
				async : true,
				data : {
					'userid' : userid,
					'money' : money
				},
				dataType : "json",
				success : function(data) {
					if(data.code)
					{
						alert(data.msg);
						window.location.reload();
					}else{
						alert(data.msg);
					}
				}
			});
			}
		});
	}); 
</script>